- /* slmsetsd.cpp by K.Tsuru */
- // function ID = 203 DRADIX
- /********************************************************************
- SLong class
- an auxiliary function for
- SLong& SLong::operator=(const SDouble& sr);
- When the exponent has a large number it takes effective figures only.
- It does not round up the hidden figures.
- **********************************************************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
- void SLong::SetSDouble(const SDouble& sr){
- int e = sr.NetRdxExp();
- if(e <= 0){ // sr = 0 || sr < 1.0;
- // 0.9999 9999 9999 .... ===> zero
- SNumber::SetZero();
- return;
- }
-
- SDouble t(sr);
- t.StdReform(203);
- e = t.RdxExp();
-
- #ifndef NDEBUG
- assert(e > 0);
- #endif
- uint H = (uint)e, last = min(t.Head(), t.EffFig()); // ver. 2.17 SDHead() --> Head()
- valloc(H, 0);
-
- register uint j;
- for(j = 1; j <= last && e > 0 ; j++, e--) figure[H-j] = t.figure(j);
- SetSign(sr.Sign());
- CheckArray(203);
- }
slmsetsd.cpp : last modifiled at 2015/11/27 14:19:12(967 bytes)
created at 2017/10/07 10:26:50
The creation time of this html file is 2017/11/09 14:52:03 (Thu Nov 09 14:52:03 2017).